<?php

class Form_ConsultarProcesso extends Zend_Form
{

    public function init()
    {
        $this->setName('cp')
            ->setMethod('post')
            ->setAction('/consultar-processo')
            ->setDecorators(array(
                'FormElements',
                array('HtmlTag', array('tag' => 'dl',
                        'class' => 'form')),
                'form'
            ))
            ->setAttrib("ajax", "✓");

        $cpf_cnpj = new Zend_Form_Element_Text('cpf_cnpj');
        $cpf_cnpj->setLabel('CPF/CNPJ:');
        $cpf_cnpj->setDecorators(array(array('ViewScript', array(
                    'viewScript' => 'forms/_element.phtml',
                    'class' => 'form element'
            ))));
        $this->addElement($cpf_cnpj);

        $numero_processo = new Zend_Form_Element_Text('numero_processo');
        $numero_processo->setLabel('Número do Processo:');
        $numero_processo->setDecorators(array(array('ViewScript', array(
                    'viewScript' => 'forms/_element.phtml',
                    'class' => 'form element'
            ))));
        $this->addElement($numero_processo);

        $captcha = new Zend_Form_Element_Captcha('captcha', array(
                'label' => 'Digite o código no campo abaixo:',
                'required' => true,
                'captcha' => array(
                    'captcha' => 'Image',
                    'font' => '/../public/captcha/arial.ttf',
                    'fontSize' => '34',
                    'wordLen' => 6,
                    'height' => '70',
                    'width' => '170',
                    'imgDir' => APPLICATION_PATH . '/../public/img/captcha',
                    'imgUrl' => Zend_Controller_Front::getInstance()->getBaseUrl() . '/img/captcha',
                    'suffix' => '.png',
                    'timeout' => 60,
                    'dotNoiseLevel' => 13,
                    'lineNoiseLevel' => 5,
                    'gcFreq' => 1
                )
            ));

        $this->addElement($captcha);

        
        $submit = new Zend_Form_Element_Button('Buscar');
        $submit->setAttrib('type', 'submit');
        $this->addElement($submit);
        
        $csrf = new Zend_Form_Element_Hash('csrf');
        $this->addElement($csrf);
    }

}

